﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrdenVentaSeparacionForm.aspx.cs" 
Inherits="UILGestion.OrdenVenta.OrdenVentaSeparacionForm" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="lib" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register src="../../Control/menuCtrl.ascx" tagname="menuCtrl" tagprefix="uc1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Pendiente Cobranza</title>
    <link href="../../css/main.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/fonts.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/global.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/theme.css" />

    <script src="../../Scripts/SearchResult.js" type="text/javascript"></script>
    
     <script type="text/javascript">
         function SelectCliente(inp, data) {

             var cliente = inp.id;
             var idcliente = cliente.replace("clienteTXT", "idClienteTXT");
             document.getElementById(cliente).value = data[2];
             document.getElementById(idcliente).value = data[0];


         }

         function goPageExportar() {


             var idProyecto = document.getElementById("idProyecto").value;
             var etapaDDL = document.getElementById("etapaDDL").value;
             var conceptoDDL = document.getElementById("conceptoDDL").value;
             var localizacionDDL = document.getElementById("localizacionDDL").value;
             var tipoUIDDL = document.getElementById("tipoUIDDL").value;
             
             

             window.open('../../Rpt/ExportExcelForm.aspx?type=COBRANZA&idProyecto=' + idProyecto.toString() +
                                                '&idEtapa=' + etapaDDL.toString() +
                                                '&concepto=' + conceptoDDL.toString() +
                                                '&localizacion=' + localizacionDDL.toString() +
                                                '&tipoUI=' + tipoUIDDL.toString());



         }
         
</script>
</head>
<body>
    <form id="form1" runat="server">
    <uc1:menuCtrl ID="menuCtrl1" runat="server" />
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"
         EnablePartialRendering="true"
          EnableScriptGlobalization="true" />
        

        <input id="idProyecto" type="hidden" runat="server" />
          <asp:Panel ID="pnlMain" runat="server"
  
CssClass="Heading secTitle AreaHeading ms-crm-List-Header "  >
<asp:Label ID="Label2" runat="server" Text="SEPARACIONES UNIDAD INMOBILIARIA POR PERIODO" 
            style="font-size: large; color: #960818"></asp:Label>
</asp:Panel>
   
    
  <asp:Panel ID="mainPNL" runat="server" BackColor="White" >

    <asp:Panel ID="PanelwButtom" runat="server"   BackColor="white"  GroupingText="Filtros de busqueda">


   
 <table class="ui-accordion">
        <tr>
            <td align="right">
                ETAPA:</td>
            <td width="200">
                <asp:DropDownList ID="etapaDDL" runat="server" AutoPostBack="true" 
                    onselectedindexchanged="etapaDDL_SelectedIndexChanged" Width="250px">
                </asp:DropDownList>
            </td>
            <td align="right" width="50px">
                &nbsp;</td>
            <td width="200">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td align="right">
                LOCALIZACION:</td>
            <td>
              <asp:UpdatePanel ID="localizacionUPNL" runat="server" UpdateMode="Conditional">
              <ContentTemplate>
                <asp:DropDownList ID="localizacionDDL" runat="server" AutoPostBack="true" 
                    onselectedindexchanged="conceptoDDL_SelectedIndexChanged" Width="250px">
                </asp:DropDownList>
              </ContentTemplate>
              <Triggers>
              <asp:AsyncPostBackTrigger ControlID="etapaDDL" />
              </Triggers>
                </asp:UpdatePanel>
              
            </td>
            <td align="right">
                AÑO:</td>
            <td>
                <asp:DropDownList ID="anioDDL" runat="server" AutoPostBack="true" 
                    onselectedindexchanged="conceptoDDL_SelectedIndexChanged" Width="250px">
                </asp:DropDownList>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td align="right" width="100">
                TIPO UNID. INMOBILIARIA:</td>
            <td>
                <asp:DropDownList ID="tipoUIDDL" runat="server" AutoPostBack="true" 
                    onselectedindexchanged="conceptoDDL_SelectedIndexChanged" Width="250px">
                </asp:DropDownList>
            </td>
            <td align="right">
                MES:</td>
            <td>
                <asp:DropDownList ID="mesDDL" runat="server" AutoPostBack="true" 
                    onselectedindexchanged="conceptoDDL_SelectedIndexChanged" Width="250px">
                </asp:DropDownList>
            </td>
            <td>
                <asp:Button ID="Button1" runat="server" CssClass="ms-crm-List-Header" 
                    OnClientClick="goPageExportar()" Text="Exportar Excel" />
            </td>
        </tr>
        <tr>
            <td align="right">
                &nbsp;</td>
            <td colspan="3">
                <%-- 
                  <lib:Input ID="clienteTXT" runat="server" Width="250px"  
                DataType="List" method="GetCliente" 
                backcolor="#DFE8F6" 
                NumColum="9" 
                 OnSelect="SelectCliente"
                AutoPostBack="true"
                ></lib:Input>--%>
              
               <%--   &nbsp;&nbsp; ID:<lib:Input ID="idClienteTXT" runat="server" AutoPostBack="true"  ReadOnly="true"
                      Width="30px"></lib:Input>
              --%>
            </td>
        </tr>
    </table>
     </asp:Panel>
    <br />

  

    <table border="0" cellpadding="0" cellspacing="0" class="tablacab">
    <tr>
    <td class="selectable" align="center">
    <%--  <asp:UpdatePanel ID="totalUPNL" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <table class="PanelTotales" width="100%" border="1">

                            <tr>
                            <td width="500px" ></td>
                                <td align="center" width="150px">
                                    Total X Cobrar:<asp:Label ID="totalXCobrarLBL" runat="server"></asp:Label>
                                </td>
                                <td align="center" width="150px">
                                    Total (+0 - 30):
                                    
                                    <asp:Label ID="total30LBL" runat="server" Text="Label"></asp:Label>
                                    
                                </td>
                                <td align="center" width="150px">Total (+30 - 60):<asp:Label ID="total3060LBL" 
                                        runat="server" Text="Label"></asp:Label>
                                </td>
                                <td align="center" width="150px">Total (60 A MAS):<asp:Label ID="total60Mas" 
                                        runat="server" Text="Label"></asp:Label>
                                </td>
                            </tr>
                           
                            
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>--%>
        </td>
    </tr>
    <tr>
    <td>
      <%--OnRowDataBound="item1GridView_RowDataBound" 
      <asp:BoundField DataField="item" HeaderText="ITEM"  />--%>

       <asp:UpdatePanel ID="totalUPNL" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
        <asp:GridView ID="itemGridView" runat="server" AutoGenerateColumns="False" 
            OnRowDataBound="itemGridView_RowDataBound" 
            Font-Size="Smaller" RowStyle-HorizontalAlign="Right" ShowFooter="false" 
            ShowHeader="true" ShowHeaderWhenEmpty="true" SkinID="GridView">
            <Columns>
           
           <asp:BoundField DataField="item" HeaderText="ITEM" HeaderStyle-Font-Size="XX-Small" ItemStyle-Font-Bold="true" ItemStyle-Width="30px" HeaderStyle-VerticalAlign="top" ItemStyle-BackColor="LightYellow"/>
           

            <asp:TemplateField ItemStyle-HorizontalAlign="Left">
                            <HeaderTemplate >
                            <asp:Label ID="ordenVentaLBL" runat="server" Font-Size="XX-Small" Width="80px"> ORDEN DE VENTA</asp:Label>
                            
                            </HeaderTemplate>
                            
                            <ItemTemplate>
                             <asp:Hyperlink runat= "server"  ForeColor="Blue" Width="80px"  ToolTip="Ir al Orden Venta "
                Text='<%# DataBinder.Eval(Container.DataItem,"ordenVenta").ToString()%>'  
                 Target="_self"  ID="OrdenCompra"
               
                  NavigateUrl='<%# "~/VentaAdmin/OrdenVenta/OrdenVentaReadForm.aspx?id=" + 
                DataBinder.Eval (Container.DataItem,"idOrdenVenta").ToString()  +
                "&idProyecto=" + DataBinder.Eval (Container.DataItem,"idProyecto").ToString()
                %>' 
                />   
               
                            
                            </ItemTemplate>
                            </asp:TemplateField>



            <asp:BoundField DataField="estado" HeaderText="ESTADO" HeaderStyle-Font-Size="XX-Small" ItemStyle-Width="50px"  ItemStyle-HorizontalAlign="Left"  HeaderStyle-VerticalAlign="top"/>
            
                            <asp:TemplateField ItemStyle-HorizontalAlign="Left">
                            <HeaderTemplate >
                            <asp:Label ID="clienteLBL" runat="server" Font-Size="XX-Small" Width="270px">CLIENTE </asp:Label>
                            
                            </HeaderTemplate>
                            
                            <ItemTemplate>
                             <asp:Hyperlink runat= "server"  ForeColor="Blue" Width="270px"  ToolTip="Ir al Cliente"
                Text='<%# DataBinder.Eval(Container.DataItem,"cliente").ToString()%>'  
                 Target="_self"  ID="OrdenCompra"
                NavigateUrl='<%# DataBinder.Eval(Container.DataItem,"formularioCliente").ToString() %>' 
                />   
               
                            
                            </ItemTemplate>
                            </asp:TemplateField>

            
            


           
            <asp:HyperLinkField HeaderText="UNID. INMOBILIARIA" HeaderStyle-Font-Size="XX-Small" ItemStyle-Width="120px"
             ControlStyle-ForeColor="Blue" 
                    DataNavigateUrlFields="idProyecto,idUI" SortExpression="UI" HeaderStyle-VerticalAlign="top"
                    DataNavigateUrlFormatString="~/VentaAdmin/UI/UIReadForm.aspx?idProyecto={0}&id={1}"
                    DataTextField="UIStr">
            </asp:HyperLinkField>

            
            <asp:BoundField DataField="fechaSep" HeaderText="FECHA SEP."  HeaderStyle-Font-Size="XX-Small" ItemStyle-Width="70px" ItemStyle-HorizontalAlign="Left" HeaderStyle-VerticalAlign="top"/>
            <asp:BoundField DataField="fechaVenStr" HeaderText="FECHA VEN."  HeaderStyle-Font-Size="XX-Small" ItemStyle-Width="70px" HeaderStyle-VerticalAlign="top" />
            
                
       
                <asp:BoundField DataField="totalStr" HeaderText="TOTAL" HeaderStyle-Font-Size="XX-Small" HeaderStyle-VerticalAlign="top" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Right" ItemStyle-BackColor="LightYellow"/>
                <asp:BoundField DataField="saldoStr" HeaderText="SALDO" HeaderStyle-Font-Size="XX-Small" HeaderStyle-VerticalAlign="top" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Right" ItemStyle-BackColor="LightYellow"/>
                
                
                
                
            </Columns>
        </asp:GridView>
        </ContentTemplate>
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="etapaDDL" />
        <asp:AsyncPostBackTrigger ControlID="anioDDL" />
        <asp:AsyncPostBackTrigger ControlID="mesDDL" />
        <asp:AsyncPostBackTrigger ControlID="localizacionDDL" />
        
        <asp:AsyncPostBackTrigger ControlID="tipoUIDDL" />


        
        </Triggers>
        </asp:UpdatePanel>
    </td>
    
    </tr>
    </table>
    
    </asp:Panel>

    <p></p>
    <p></p>
    <div>

    
    </div>
    </form>
</body>
</html>
